package metier.userService;

import java.util.List;

import metier.entite.user.TypeUser;
import metier.entite.user.User;
import metier.exceptions.AuthentificationException;
import metier.exceptions.ChargerListException;
import metier.exceptions.GetUserException;
import metier.exceptions.RemoveException;
import metier.exceptions.ResetDBException;
import metier.exceptions.UpdateException;

public interface UserService {

	/**
	 * 
	 * @param userName
	 * @param password
	 * @return
	 * @throws AuthentificationException
	 */
	public User connectUser(String userName, char[] password) throws AuthentificationException;


	/**
	 * Reset User Data Base
	 * <br> Create a default admin1
	 * @throws ResetDBException
	 */
	public void resetDataBase() throws ResetDBException;

	/**
	 * Charger la liste des Utilisateurs de type {@link TypeUser.Client}
	 * 
	 * @return
	 * @throws ChargerListException
	 */
	public List<User> chargerListUserClient() throws ChargerListException ;

	/**
	 * Charger la liste de tous les utilisateurs
	 * 
	 * @return
	 * @throws ChargerListException
	 */
	public List<User> chargerListAllUsers() throws ChargerListException ;

	/**
	 * 
	 * @param updatedUser
	 */
	public void updateUser( User updatedUser) throws UpdateException;
	
	/**
	 * Supprimer un Utilisateur de la base
	 * 
	 * @param user
	 * @throws RemoveException
	 */
	public void supprimerUser(User user) throws RemoveException;
	
	/**
	 * Get User By User Name
	 * 
	 * @param UserName
	 * @return
	 * @throws GetUserException
	 */
	public User getUserByUserName(String UserName) throws GetUserException;
	
	/**
	 * Get User By UserName
	 * 
	 * @param id
	 * @return
	 * @throws GetUserException
	 */
	public User getUserById(int id) throws GetUserException;

}

